import dayjs, { Dayjs } from 'dayjs';
export const searchConfig = {
    disinfectName: {
        component: "AInput",
        label: '手消液名称',
        attrs: {
            allowClear: true,
            placeholder: '手消液名称',
            style: {
                width: '100%'
            }
        }
    },
    type: {
        component: "AInput",
        label: '类型',
        attrs: {
            allowClear: true,
            placeholder: '类型',
            style: {
                width: '100%'
            }
        }
    },
    model: {
        component: "AInput",
        label: '型号',
        attrs: {
            allowClear: true,
            placeholder: '型号',
            style: {
                width: '100%'
            }
        }
    },
    capacity: {
        component: "AInput",
        label: '容量(ml)',
        attrs: {
            allowClear: true,
            placeholder: '容量(ml)',
            style: {
                width: '100%'
            }
        }
    }
}

export const addConfig = {
    disinfectName: {
        component: "AInput",
        label: '手消液名称',
        attrs: {
            allowClear: true,
            placeholder: '手消液名称',
            style: {
                width: '100%'
            }
        },
        rules: [
            { required: true, message: '请输入手消液名称！', trigger: 'blur' },
        ]
    },
    type: {
        component: "AInput",
        label: '类型',
        attrs: {
            allowClear: true,
            placeholder: '类型',
            style: {
                width: '100%'
            }
        },
        rules: [
            { required: true, message: '请输入类型！', trigger: 'blur' },
        ]
    },
    model: {
        component: "AInput",
        label: '型号',
        attrs: {
            allowClear: true,
            placeholder: '型号',
            style: {
                width: '100%'
            }
        },
        rules: [
            { required: true, message: '请输入型号！', trigger: 'blur' },
        ]
    },
    capacity: {
        component: "AInput",
        label: '容量(ml)',
        attrs: {
            allowClear: true,
            placeholder: '容量(ml)',
            style: {
                width: '100%'
            }
        },
        rules: [
            { required: true, message: '请输入容量！', trigger: 'blur' },
        ]
    }
}


export const editConfig = {
    disinfectName: {
        component: "AInput",
        label: '手消液名称',
        attrs: {
            allowClear: true,
            placeholder: '手消液名称',
            style: {
                width: '100%'
            }
        },
        rules: [
            { required: true, message: '请输入手消液名称！', trigger: 'blur' },
        ]
    },
    type: {
        component: "AInput",
        label: '类型',
        attrs: {
            allowClear: true,
            placeholder: '类型',
            style: {
                width: '100%'
            }
        },
        rules: [
            { required: true, message: '请输入类型！', trigger: 'blur' },
        ]
    },
    model: {
        component: "AInput",
        label: '型号',
        attrs: {
            allowClear: true,
            placeholder: '型号',
            style: {
                width: '100%'
            }
        },
        rules: [
            { required: true, message: '请输入型号！', trigger: 'blur' },
        ]
    },
    capacity: {
        component: "AInput",
        label: '容量(ml)',
        attrs: {
            allowClear: true,
            placeholder: '容量(ml)',
            style: {
                width: '100%'
            }
        },
        rules: [
            { required: true, message: '请输入容量！', trigger: 'blur' },
        ]
    }
}

export const exportConfig = {
    TimeArr: {
        component: 'ARangePicker',
        label: '时间',
        attrs: {
            allowClear: true,
            placeholder: ['开始时间', '结束时间'],
            valueFormat: 'YYYY-MM-DD',
            format: 'YYYY-MM-DD',
            defaultPickerValue: [dayjs().subtract(3, 'month'), dayjs().add(0, 'day')],
            disabledDate: (current: Dayjs) => {
                const lastDate = dayjs().subtract(3, 'month')
                const tomorrow = dayjs().add(0, 'day')
                return (lastDate > current || tomorrow < current)
            },
            style: {
                width: '100%'
            }
        },
        rules: [{ required: true, message: '请选择时间', trigger: 'blur' }]
    }
}

export const columns = [
    {
        title: '序号',
        dataIndex: 'index',
        align: 'center',
        width: 80,
        fixed: 'left'
    },
    {
        title: '手消液名称',
        dataIndex: 'disinfectName',
        align: 'center'
    },
    {
        title: '手消液类型',
        dataIndex: 'type',
        align: 'center'
    },
    {
        title: '手消液型号',
        dataIndex: 'model',
        align: 'center'
    },
    {
        title: '手消液容量(ml)',
        dataIndex: 'capacity',
        align: 'center'
    },
    {
        title: '操作',
        dataIndex: 'action',
        align: 'center',
        width: 300
    },
]


export const columnsInfo = [
    {
        title: '序号',
        dataIndex: 'index',
        align: 'center',
        width: 80,
        fixed: 'left'
    },
    {
        title: '设备名称',
        dataIndex: 'deviceName',
        align: 'center'
    },
    {
        title: '序列号',
        dataIndex: 'serial',
        align: 'center'
    },
    {
        title: '手消液名称',
        dataIndex: 'disinfectName',
        align: 'center'
    },
    {
        title: '有效期(天)',
        dataIndex: 'indata',
        align: 'center'
    },
    {
        title: '开封日期',
        dataIndex: 'startData',
        align: 'center'
    },
    {
        title: '更换日期',
        dataIndex: 'endData',
        align: 'center'
    },
    // {
    //     title: '序号',
    //     dataIndex: 'index',
    //     align: 'center'
    // },
]